Skip to content

test: systematically cover Seaborn plotting interoperability - #841

Closed
cvanelteren wants to merge 1 commit into
mainfrom
test/seaborn-compatibility
Closed

cvanelteren wants to merge 1 commit into
mainfrom
test/seaborn-compatibility

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

UltraPlot's existing Seaborn tests protect specific legend and rendering regressions but do not exercise the public statistical plotting API systematically. Add a separate compatibility suite alongside them, using deterministic local data and keeping all existing tests unchanged.

  • Cover all 17 current axes-level plotting functions with 20 cases in automatic detection and explicit ax.external() modes (40 tests). Include hue/size semantics, bootstrapped uncertainty, stacked histograms, filled and bivariate densities, horizontal categories, annotated heatmaps, and colorbars.
  • Check returned axes identity, nonempty plot artists, hue labels where exposed as axes legends, UltraPlot formatting, canvas drawing, and restoration of external mode. Close figures even on failure.
  • Cover seaborn.objects.Plot.on(ax) with Dot, Bar+Hist, and Line+Agg (3 tests).
  • Inventory the axes-level, figure-level, grid, objects, and deprecated interfaces in the module docstring. Exercise all seven figure-level plotting entry points (7 tests), asserting separate figure ownership and coexistence with a current UltraPlot figure. This is a documented embedding limitation, not an axes compatibility claim. Figure-level grids cannot generally be placed into existing axes with ax=; use axes-level counterparts.

Validation (Python 3.12, Seaborn 0.13.2):

  • Matplotlib 3.10.8: new suite, 50 passed.
  • Matplotlib 3.9.4: new suite, 50 passed.
  • Integration + compatibility + legend modules on Matplotlib 3.10.8: 167 passed, 9 skipped. This was a regular pytest run, not pixel-baseline comparison with --mpl.
  • Black and git diff whitespace checks passed.

No concrete incompatibility was reproduced in these cases, so no runtime fixes or statistical reimplementation are included. This establishes smoke coverage of the current API, not exhaustive combinations of options, datasets, Seaborn versions, or grid kinds. Seaborn remains optional via importorskip; the existing CI environment already includes it.

Related: #840. Preserves regressions from #406 and #793.

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/tests/test_seaborn_compatibility.py 98.41% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant